package com.snl.micro.blog.common.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArticleQueryParam {

    private Long id;
    private String title;
    private Long userId;
    private Integer themeCode;
    private String message;

    /**
     * 该文章的作者
     */
    private String author;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    //当前页面展示的页码
    private Integer pageSize;
    //当前页数
    private Integer currentPage;

//    public void setCreateTime(String createTime) {
//        if (Objects.equals(createTime,"")) {
//            this.createTime = LocalDateTime.now();
//        } else {
//            this.createTime = LocalDate.parse(createTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")).atStartOfDay();
//        }
//        }



}
